home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Aug 15 1996
- //
- // Description:
- // This procedure creates the main maya window.
- //
- {
-
- global string $gUIpathDiv;
-
- global string $gMainWindow;
- global string $gMainWindowForm;
- global string $gStatusLineForm;
- global string $gShelfForm;
- global string $gWorkAreaForm;
- global string $gMainPane;
- global string $gToolboxForm;
- global string $gTimeSliderForm;
- global string $gPlaybackRangeForm;
- global string $gCommandLineForm;
- global string $gHelpLineForm;
- global string $gAttributeEditorForm;
- global string $gToolSettingsForm;
- global string $gChannelsLayersForm;
- global string $gMayaLiveControlForm;
-
- // These globals track the visibility of the corresponding window
- // component. Whenever a toggleUIComponentVisibility("Component") call
- // is made these values are updated. Set all these flags to be
- // initially visible, they will be updated accordingly when each
- // component is initialized and their startup preferences are
- // loaded.
- //
- global int $gStatusLineVisible = 1;
- global int $gShelfVisible = 1;
- global int $gToolboxVisible = 1;
- global int $gTimeSliderVisible = 1;
- global int $gPlaybackRangeVisible = 1;
- global int $gCommandLineVisible = 1;
- global int $gHelpLineVisible = 1;
- global int $gAttributeEditorVisible = 1;
- global int $gToolSettingsVisible = 1;
- global int $gChannelsLayersVisible = 1;
-
- // Default size of window is full screen.
- //
- int $top = 33;
- int $left = 9;
- int $width = 1262;
- int $height = 982;
-
- if (`about -nt`) {
- // window size/position is non-client size.
- $top = 0;
- $left = 0;
- $width = 1280;
- $height = 1024;
- }
-
- if (`about -mac`) {
- // default to a 1024 x 768 display
- //
- $top = 0;
- $left = 0;
- $width = 1024;
- // allow space for the title bar and the dock
- //
- $height = 768 - 24 - 72;
- }
-
- // Read in the preference values.
- //
- int $useTitleBar = `optionVar -q mainWindowTitleBarVis`;
- int $menubarVis = `optionVar -q mainWindowMenubarVis`;
-
- // Create the main Maya window.
- //
- if ( `about -evalVersion` ) {
- $gMainWindow = `window
- -retain
- -mainWindow
- -menuBar true
- -menuBarVisible $menubarVis
- -topLeftCorner $top $left
- -widthHeight $width $height
- -titleBar $useTitleBar
- -title "Maya Personal Learning Edition"
- -iconName "Maya Personal Learning Edition"
- "MayaWindow"`;
- } else {
- $gMainWindow = `window
- -retain
- -mainWindow
- -menuBar true
- -menuBarVisible $menubarVis
- -topLeftCorner $top $left
- -widthHeight $width $height
- -titleBar $useTitleBar
- -title "Maya"
- -iconName "Maya"
- "MayaWindow"`;
- }
-
- // if a title bar was specified, annotate it so that it
- // will always display the current file and selected object.
- //
- if ( $useTitleBar ){
- showSelectionInTitle "MayaWindow";
- }
-
- // ------------------------------------------------------------
- // Top level form.
- // ------------------------------------------------------------
-
- // Create the top level layout for the main Maya window.
- //
- $gMainWindowForm = `formLayout mayaMainWindowForm`;
-
- // ------------------------------------------------------------
- // Horizontal components, ie. those across the top and bottom
- // of the main layout.
- // ------------------------------------------------------------
-
- // The Status line.
- //
- $statusLine = `formLayout -parent $gMainWindowForm`;
-
- // The Shelf and Toolbox.
- //
- $shelf = `formLayout -parent $gMainWindowForm`;
-
- // The Work area. This contains the main view panes, the
- // Attribute Editor, and the Channel Box.
- //
- $gWorkAreaForm = `formLayout -parent $gMainWindowForm`;
-
- // The Time slider.
- //
- // NOTE that the name of this form is TimeSliderForm. This is
- // referenced from mlControlPanel.mel. If you change it here
- // you must change it there. Maya Live needs to insert a
- // panel of controls above the Time Slider and below the work
- // area.
- //
- $timeSlider = `formLayout -parent $gMainWindowForm TimeSliderForm`;
-
- // The Playback range.
- //
- $playbackRange = `formLayout -parent $gMainWindowForm`;
-
- // The Command line.
- //
- $commandLine = `formLayout -parent $gMainWindowForm`;
-
- // The Help line.
- //
- $helpLine = `formLayout -parent $gMainWindowForm`;
-
- // Maya Live Control Panel.
- //
- $mayaLive = `formLayout -parent $gMainWindowForm`;
-
- // ------------------------------------------------------------
- // Vertical components, ie. the left and right side components
- // as well as the main work area of the window.
- // ------------------------------------------------------------
-
- // The view panes.
- //
- $gMainPane = `paneLayout -parent $gWorkAreaForm viewPanes`;
-
- // The Toolbox.
- //
- $toolbox = `formLayout -parent $gWorkAreaForm`;
-
- // The Attribute Editor.
- //
- $attributeEditor = `formLayout -parent $gWorkAreaForm`;
-
- // The Attribute Editor.
- //
- $toolSettings = `formLayout -parent $gWorkAreaForm`;
-
- // The combined Channel Box / Layer Editor area.
- //
- $channelsLayers = `formLayout -parent $gWorkAreaForm`;
-
- // ------------------------------------------------------------
- // Create the UI Component Bars.
- // ------------------------------------------------------------
- source "UIComponents.mel";
-
- createUIComponentBar("Maya Top Component Bar", "top");
- createUIComponentBar("Maya Bottom Component Bar", "bottom");
- createUIComponentBar("Maya Left Component Bar", "left");
- createUIComponentBar("Maya Right Component Bar", "right");
-
- // ------------------------------------------------------------
- // Now create the UI component areas.
- // ------------------------------------------------------------
- //
- // Use the createUIComponent() procedure to create collapsable areas
- // for each component. Each collapsable component will have a visible
- // button for hiding the component.
- //
-
- $gStatusLineForm = createUIComponent(
- "Maya Top Component Bar", "Status Line", $statusLine);
-
- $gShelfForm = createUIComponent(
- "Maya Top Component Bar", "Shelf", $shelf);
-
- $gTimeSliderForm = createUIComponent(
- "Maya Bottom Component Bar", "Time Slider", $timeSlider);
-
- $gPlaybackRangeForm = createUIComponent(
- "Maya Bottom Component Bar", "Range Slider", $playbackRange);
-
- $gCommandLineForm = createUIComponent(
- "Maya Bottom Component Bar", "Command Line", $commandLine);
-
- $gHelpLineForm = createUIComponent(
- "Maya Bottom Component Bar", "Help Line", $helpLine);
-
- $gMayaLiveControlForm = createUIComponent(
- "Maya Bottom Component Bar", "Maya Live Control Panel", $mayaLive);
-
- $gToolboxForm = createUIComponent(
- "Maya Left Component Bar", "Tool Box", $toolbox);
-
- $gAttributeEditorForm = createUIComponent(
- "Maya Right Component Bar", "Attribute Editor", $attributeEditor);
-
- $gToolSettingsForm = createUIComponent(
- "Maya Right Component Bar", "Tool Settings", $toolSettings);
-
- $gChannelsLayersForm = createUIComponent(
- "Maya Right Component Bar", "Channel Box / Layer Editor", $channelsLayers);
-
- // Specify the non-component areas.
- //
- setUIComponentWorkArea("Maya Top Component Bar", $gWorkAreaForm);
-
- setUIComponentWorkArea("Maya Bottom Component Bar", $gWorkAreaForm);
-
- setUIComponentWorkArea("Maya Left Component Bar", $gMainPane);
-
- setUIComponentWorkArea("Maya Right Component Bar", $gMainPane);
-
- // ------------------------------------------------------------
-
- // Create a default cluster for any toolbox or shelf tools.
- //
- if (!`toolCollection -exists toolCluster`) {
- toolCollection -global true toolCluster;
- }
-
- formLayout -edit
- -attachForm $toolbox "top" 0
- -attachForm $toolbox "left" 0
- -attachForm $toolbox "bottom" 0
- -attachNone $toolbox "right"
-
- -attachForm $gMainPane "top" 0
- -attachControl $gMainPane "left" 0 $toolbox
- -attachForm $gMainPane "bottom" 0
- -attachControl $gMainPane "right" 0 $attributeEditor
-
- -attachForm $attributeEditor "top" 0
- -attachNone $attributeEditor "left"
- -attachForm $attributeEditor "bottom" 0
- -attachControl $attributeEditor "right" 0 $toolSettings
-
- -attachForm $toolSettings "top" 0
- -attachNone $toolSettings "left"
- -attachForm $toolSettings "bottom" 0
- -attachControl $toolSettings "right" 0 $channelsLayers
-
- -attachForm $channelsLayers "top" 0
- -attachNone $channelsLayers "left"
- -attachForm $channelsLayers "bottom" 0
- -attachForm $channelsLayers "right" 0
-
- $gWorkAreaForm;
-
- // Set up attachments for the main window components.
- //
- formLayout -edit
- -attachForm $statusLine "top" 0
- -attachForm $statusLine "left" 0
- -attachNone $statusLine "bottom"
- -attachForm $statusLine "right" 0
-
- -attachControl $shelf "top" 2 $statusLine
- -attachForm $shelf "left" 0
- -attachNone $shelf "bottom"
- -attachForm $shelf "right" 0
-
- -attachControl $gWorkAreaForm "top" 0 $shelf
- -attachForm $gWorkAreaForm "left" 0
- -attachControl $gWorkAreaForm "bottom" 0 $mayaLive
- -attachForm $gWorkAreaForm "right" 0
-
- -attachNone $mayaLive "top"
- -attachForm $mayaLive "left" 0
- -attachForm $mayaLive "right" 0
- -attachControl $mayaLive "bottom" 0 $timeSlider
-
- -attachNone $timeSlider "top"
- -attachForm $timeSlider "left" 0
- -attachForm $timeSlider "right" 0
- -attachControl $timeSlider "bottom" 0 $playbackRange
-
- -attachNone $playbackRange "top"
- -attachForm $playbackRange "left" 0
- -attachForm $playbackRange "right" 0
- -attachControl $playbackRange "bottom" 0 $commandLine
-
- -attachNone $commandLine "top"
- -attachForm $commandLine "left" 0
- -attachForm $commandLine "right" 0
- -attachControl $commandLine "bottom" 0 $helpLine
-
- -attachNone $helpLine "top"
- -attachForm $helpLine "left" 0
- -attachForm $helpLine "bottom" 0
- -attachForm $helpLine "right" 0
-
- $gMainWindowForm;
- }
-